<template>
	<view>
	 <view class="row">
         <image bindtap="closeDialog" class="image-close" src="../../images/detail/close.png"></image>
        <image class="image-feature" src="http://mz.djmall.xmisp.cn/files/product/20161201/148057921620_middle.jpg"></image>
        <view class="column">
          <text class="feature-price">￥{{price}}</text>
          <text class="feature-title">库存{{requireInventory}}件</text>
           <text class="feature-title">商品编码：{{otherCode}}</text>
        </view>
      </view>
      <text class="border-line"></text>
      <view class="row">
        <text >购买数量</text>
        <view class="quantity-position">
        </view>
      </view>
      <text class="border-line"></text>

      <button class="button-green" bindtap="addToCart" formType="submit">加入购物车</button>
      <button class="button-red" formType="submit">立即购买</button>
	</view>
</template>

<script>
	import numberBox from './number-box.vue'
	export default {
		components:{
			numberBox
		},
		props:{
			imgUrls: [],
			isLike: {type: String, default: "N"},
			indicatorDots: {type: Boolean, default: true}, //是否显示面板指示点
			autoplay: {type: Boolean, default: true}, //是否自动切换
			interval: {
				type: Number,
				default: 3000,
			}, //自动切换时间间隔,3s
			duration: 1000, //  滑动动画时长1s
			content:[],
			productId: {
				type:String,
				default: "",
				required: true
			},
			features: [],
			featuresTypes: []
			
		},
		methods:{
			previewImage: function(e){
				var current = e.target.dataset.src;
				uni.previewImage({
					current: current, // 当前显示图片的http链接  
					urls: this.imgUrls // 需要预览的图片http链接列表  
				})
			},
			addCollection: function() {
				
			},
			addToCart: function(){
				
			}
		}
	}
</script>

<style>
.image-feture {
  width: 200upx;
  height: 200upx;
  z-index: 12;
  position: absolute;
  left: 20upx;
  top: -30upx;
  border-radius: 20upx;
}
.image-close {
  width: 40upx;
  height: 40upx;
  position: fixed;
  right: 10upx;
  top: 10upx;
}

.feature-title {
  position: relative;
  left: 300upx;
  margin: 1upx;
}
.feature-price {
  color: red;
  position: relative;
  left: 300upx;
  margin: 1upx;
}
.uni-row-center .quantity-position {
  position: absolute;
  right: 30upx;
}


</style>
